import { createSlice } from '@reduxjs/toolkit'

const initialState = [
    {
        name:'wy',
        gender:'女',
        doctor:'华佗',
      },
]

const messageSlice = createSlice({
  name: 'usermessage',
  initialState,
  reducers: {
    messageadd(state,action){
      state.push(action.payload)
    }
  }
})
export const {messageadd}=messageSlice.actions//导出与reducer函数同名的action
export default messageSlice.reducer